<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head><title>Vista and Window 7 Compatibility</title>

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="expires" content="" />
<meta name="lang" content="en-US" />
<meta name="template-info" content="topic.htm 2012-03-19 usp" />
<meta name="creation-date" scheme="iso8601" content="2013-06-25" />
<meta name="last-modified" scheme="iso8601" content="2013-06-25" />
<meta name="publication-date" scheme="iso8601" content="" />
<meta name="version" content="1" />
<meta name="author" content="USP" />
<meta name="robots" content="follow" />
<meta name="category" content="Programming/Deployment" />
<meta name="keywords" content="programming, deployment, setup." />
<meta name="description" content="" />

<link rel="stylesheet" type="text/css" href="../../../includes/topic-2.css" />
<link rel="stylesheet" type="text/css" href="../local.css" />

<script language="JavaScript" type="text/javascript" src="../../../includes/global.js"></script>
<script language="JavaScript" type="text/javascript" src="../../../includes/cookies.js"></script>
<script language="JavaScript" type="text/javascript" src="../../../includes/topic.js"></script>
<script language="JavaScript" type="text/javascript" src="../local.js"></script>

</head><body class="content" onload="onloadTopic()"><a name="top"></a>

<h1>Vista and Windows 7 Compatibility</h1>

<p>Times have changed since VS2003. Windows has now UAC. Security features that make developer's life a little bit more complicated.</p>

<p>VS2003 setup and deployment projects run fine under W7 &mdash; as long as you don't add a DotNET custom action, implemented in a DotNET installer class. It begins with a friendly question to approve the potential risky action to tamper with the system and its installation. Since this is what we want, we usually give our OK. Even the test form launched by our custom action DLL shows up. Everything seems fine, but a little later, after the custom action Install method returns, you get a mysterious 2869 error:</p>

<p class="imgbox"><a name="fig-018"></a><img src="../img/fig-018.png" /><br/>Figure 18: The 2869 Error prevents installation.</p>

<p>Interestingly, other custom actions, such as calling a .exe, do not present this odd behavior. (But I have not checked other combinations.)</p>

<p>To make it work, you need an msi editor tool, such as <a href="http://www.instedit.com">InstEd</a>, or ORCA, a Microsoft tool, part of the W7 SDK.</p>

<p>After adding a custom action to the setup project, a new entry appeared in the CustomAction table of the msi, with a type flag set to 0x401:</p>

<p class="imgbox"><a name="fig-019"></a><img src="../img/fig-019.png" /><br/>Figure 19: Custom action in the msi package.</p>

<p>Now add 0x800 to this value, i. e. change the value to 0xC01, as indicated in figure 19. This prevents the installer from "impersonating" custom actions, and effectively lower the permission level to the user's default level. </p>

<p>I saw three instances of msiexec.exe running on my system when the error happened, so I assume that one instance launched the third for running the custom action with the User's default permission set, and maybe passing data across this problematic process boundary caused the error.</p>


<div class="footer"><hr />
<p>Page author: USP &bull; Page editor: USP &bull; Last update: 2013-06-25 &bull; 1</p>
<p>&copy; 2013 Synesis Ulrich Sprick. All rights reserved. See <a href="../../../copyright.htm">Copyright details</a>.</p>
<p><a href="#top">Back to Top</a> | <a href="../../../index.htm" target="_top">Home</a> | <a id="reload" onclick="reloadFrameset()" href ="../../../index.htm" target="_top" >Reload Frameset</a></p>
</div></body></html>
